package com.example.mybatisdemo.mapper;

import com.example.mybatisdemo.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ArticleInfoMapper {
    //多表查询
    @Select("select ta.*, tb.username,tb.age,tb.gender from articleinfo ta" +
            " LEFT JOIN userinfo tb on ta.uid = tb.id" +
            " where ta.id=#{id}")
    ArticleInfo queryUserById(Integer id);

}
